<?php

if (isset($_GET["movie"])) {

	require_once("php/config.php");
	require_once("php/postgres.php");
	
	try {
	
		$confs = $GLOBALS["CONFIGS"]["PSQL_DB"];
		$pgcon = new PostgresConnection($confs["HOST"], $confs["PORT"], $confs["USER"], $confs["PASSWORD"], $confs["DATABASE"]);
		
		if ($pgcon->getAllMovies(array("nome" => $_GET["movie"])) == null) {
			
			echo 0;
		} else {
		
			echo 1;
		}
	} catch (PostgresConnectionException $pce) {
	
		die("3");
	}
}

?>